Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

log consumer opens, closes, and exceptions #245

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

yaauie
Copy link
Contributor

@yaauie yaauie commented Jan 6, 2018

While looking into reports of slowdowns that are only solved by restarting the pipeline, I discovered that it is possible for an exception to be raised in one of the consumer threads silently (e.g., not raised until we attempt to join the thread).

This patch adds useful logging, including that of uncaught exceptions.

It is unverified; there are no tests besides register, and I don't have a kafka installation yet.

Copy link

@andrewvc andrewvc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just needs to have the logging be structured.

raise e
end
rescue => e
logger.error("uncaught exception in consumer #{consumer_identifier}: #{e}")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use structured logging in these places? Logstash loggers let you say:

logger.error("uncaught exception in consumer", :consumer_identifier => consumer_identifier, :message => e.message, :error_class => e.class.name, :error_backtrace => e.backtrace)

@yaauie yaauie force-pushed the consumer-logging branch from a64ab5d to 90db37d Compare May 1, 2018 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants